$(document).ready(function(){
    $("#list").jqGrid({
        url:'sqldata.php',
        datatype: "json",
        colNames:['Id','User','Message'],
        colModel:[
                {name:'id', index:'id', width:50,resizable:false, sorttype:"int",resizable:false,editrules:{readonly:true} },
                {name:'user', index:'user', width:55,editable:true,edittype:"text",editoptions:{size:30,maxlength:50},editrules:{required:true}},
                {name:'message', index:'message', width:90, editable:true,edittype:"text",editoptions:{size:30,maxlength:50},editrules:{required:true}}
            ],
            rowNum:30,
            rowList:[10,20,30],
            pager: '#pager',
            sortname: 'id',
        viewrecords: true,
        sortorder: "desc",
        width:450,
        editurl:"AddEdit.php",

        imgpath: 'jqGrid/themes/basic/images',
        caption: 'My first datagrid'
    });
    $("#list").navGrid('#pager',{
            edit:true, add:true, del:true, view:false, search:false
        });
    //$("#list").addRowData("40",{user:"xyz",message:"message"});
});